{% if not environment.web and pageData["direct_print"] != True %}
{% extends 'index.html' %}
{% endif %}
{% block body %}
<div class="row">
     <div class="col-xs-12 col-md-12">
        <div class="panel panel-default">
  <div class="panel-heading"><h3>Del {{utils.dateToString(pageData["dao"].data_inserimento)}}</h3></div>
  <div class="panel-body">
<div class="col-sm-12"><span class="label label-default">Cliente</span><h4 style="display:inline;"> {{pageData["dao"].cliente_testata_scontrino.ragione_sociale}}</h4>
</div>
      </div>
      <div class="clearfix"></div>
      <div class='col-sm-12'><hr></div>
      <!--<h3>TOTALI</h3>-->
      <div class="col-sm-9">
        <div class="col-sm-3"><span class="label label-danger">SCONTO</span>
            {% if pageData["dao"].sconti %}
            <h4><strong>
            {{utils.mNLC(pageData["dao"].sconti[0].valore or 0,2)}}{{utils.scontiTipo(pageData["dao"].sconti[0].tipo_sconto)}}</strong></h4>
        {% endif %}
        </div>
        <div class="col-sm-3"><span class="label label-danger">ASSEGNO</span><h4><strong> {{utils.mNLC(pageData["dao"].totale_assegni or 0,2)}}</strong></h4></div>
                      <div class="col-sm-3"><span class="label label-danger">C.CREDITO</span><h4><strong> {{utils.mNLC(pageData["dao"].totale_carta_credito or 0,2)}}</strong></h4></div>
                      <div class="col-sm-3"><span class="label label-danger">CONTANTI</span><h4><strong> {{utils.mNLC(pageData["dao"].totale_contanti or 0,2)}}</strong></h4></div>
                  </div>                   <div class="col-sm-3">

<div style="margin-top:5px;margin-bottom:10px;" class="alert alert-danger col-sm-12 pull-right" role="alert"><h4 style="display:inline;">TOTALE &nbsp;</h4> <h4 class="pull-right" style="display:inline;"><strong><big> {{utils.mNLC(pageData["dao"].totale_scontrino or 0,2)}}</big></strong></h4></div>
  </div>

      <div class="clearfix"></div>
                <div class="panel panel-warning">
            <div class="panel-heading">
              <h3 class="panel-title">RIGHE&nbsp;&nbsp; ({{dao.righe|length}})</h3>
            </div>
            <div class="panel-body">
<div class="table-responsive">
  <table class="table  table-bordered table-striped table-condensed">
          <tr>
        <th >Articolo</th>
        <th >C barre</th>
        <th >Descrizione</th>
        <th >Q.a'</th>
        <th >Prezzo</th>
        <th >Sconto</th>
        <th >Netto</th>
        <th >TOTALE</th>
        </tr>
{% for riga in pageData["dao"].righe %}
            <tr >
            <td >{{riga.codice_articolo}}</td>
            <td >{{riga.codice_a_barre}}</td>
            <td >{{riga.descrizione[:20]}}</td>
            <td >{{utils.mN(riga.quantita or 0,1)}}</td>
            <td >{{utils.mNLC(riga.prezzo or 0,2)}}</td>
            {% if riga.tipo_sconto == 'percentuale' %}
            <td >
                {{utils.number_format() % (riga.valore_sconto or 0) + "%"}}
            </td>
            {% else%}
            <td >
                {{utils.number_format() % (riga.valore_sconto or 0) + " "}}
            </td>
            {% endif %}
            <td >{{utils.mNLC(riga.prezzo_scontato or 0,2)}}</td>
            <td><strong>{{utils.mNLC((riga.quantita * riga.prezzo_scontato ) or 0,2)}}</strong></td>
        </tr>
            {% endfor %}
  </table>
</div>

                </div>
            </div>

               <div style="margin-bottom:20px;" class="clearfix"></div>
            {#% if pageData["tutto"] == True %#}
              <div class="col-sm-12">
          <div class="panel panel-info">
            <div class="panel-heading">
              <h3 class="panel-title">INFORMAZIONI ACCESSORIE</h3>
            </div>
            <div class="panel-body">


                <div class="col-sm-12"><span class="label label-info">Punto Vendita</span> {{pageData["dao"].mag.denominazione}}</div>
                <div class="col-sm-12"><span class="label label-info">Punto Cassa</span> {{pageData["dao"].poss.denominazione}}</div>
                <div class="col-sm-12"><span class="label label-info">Operatore</span> {{pageData["dao"].operatore}}</div>
                 <div class="col-sm-12"><span class="label label-info">Tipo Carta di credito</span> {{pageData["dao"].cctypee.denominazione}}</div>
            </div>
          </div>
  </div>
            {#% endif %#}



        </div>
    </div>
</div>
{% endblock %}